﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace DungDungShit
{
    class Person : Sprite
    {
        // 보상, 돈, 시간, 체력
        int type = 0;
        int tid = 0;
        public int Type { get { return type; } }
        public int Tid { get { return tid; } }
        
        int[,] prize = {{1, 50, 100, 1, 200},
                              {2, 70, 300, 2, 100},
                              {0, 40, 50, 2, 200},
                              {1, 60, 200, 3, 150}};
        public int Prize() { return prize[tid, type]; }
        public int BasicPrize() { return prize[tid, 4]; }
        public Texture2D Texture {get {return defaultTexture;}}

        public Person(Texture2D defaultTexture, IntVector2 position, IntVector2 frameSize, IntVector2 sheetSize, int tid, int type)
			: base(defaultTexture, position, frameSize, sheetSize)
		{
            this.tid = tid;
            this.type = type;
            this.layerDepth = 0.6f;
		}

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch, Vector2 origin)
        {

            //Matrix ang = Matrix.CreateTranslation(GameScreen.mapViewWidth / 2, GameScreen.mapViewHeight / 2, 0);
            //spriteBatch.End();
            //spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, null, null, null, null, ang);
            spriteBatch.Draw(defaultTexture,
                    new Vector2(Position.X * TileSize.X / 2 + SubPosition.X, Position.Y * TileSize.Y / 2 + SubPosition.Y),
                    new Rectangle(type * frameSize.X,
                        currentFrame.Y * frameSize.Y,
                        frameSize.X, frameSize.Y),
                    Color.White, 0, origin * 0.625f + new Vector2(26, 56),
                    0.8f, SpriteEffects.None, layerDepth);
            //spriteBatch.End();
            //spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, null, null, null, null, ang);
        }
    }
}
